<%@ taglib prefix="border-style" uri="http://www.springframework.org/tags/form" %>
<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/9
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
<head>
	<base href="<%=basePath%>">
	<link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
	<link href="css/print.css" rel="stylesheet" type="text/css" media="print"/>
	<script src="js/jquery-1.10.1.min.js"></script>
	<script src="js/side.js" type="text/javascript"></script>
	<script src="js/jquery-3.6.0.js"></script>
	<script>
        function Cancle_Enterprise(comId1) {
            var comId = comId1;
            $.ajax({
                url: 'Enterprise_info/Cancle_Enterprise',
                headers: {
                    'Content-Type': 'application/json;charset=utf-8',
                },
                type: 'GET',
                data: {
                    "comId": comId
                },
                dataType: "json",
                success: function (data) {
                    if (data.code == '0110') {
                        console.log(data.message);
                        alert("注销失败");
                    } else if (data.code == '0111') {
                        console.log(data.message);
                        alert("注销成功");
                        window.location.href = "jsp/Enterprise_login.jsp";
                    }
                }
            })
        }
	</script>
	<script>
        function Update_Enterprise(e) {
            var formObject = {};
            var formArray = $("#form2").serializeArray();
            $.each(formArray, function (i, item) {
                formObject[item.name] = item.value;
            });
            $.ajax({
                url: 'admin_info/Update_Enterprise',
                headers: {
                    'Content-Type': 'application/json;charset=utf-8',
                },
                type: 'POST',
                data: JSON.stringify(formObject),
                dataType: "json",
                success: function (data) {
                    if (data.code == '0100') {
                        console.log(data.masage);
                        alert("修改失败");
                    } else if (data.code == '0102') {
                        window.location.href = 'jsp/enterprise.jsp?comAccount=' + data.data;
                    } else if (data.code == '0101') {
                        console.log(data.masage);
                        alert("修改成功");
                        window.location.reload();
                    }
                }
            })
        }
	</script>
	<style>
        .btnc {
            top: 6.1%;
            right: 5.5%;
            position: absolute;
            color: red;
        }
        .im1{
            height:25px;
	        width:25px;
            position: absolute;
	        top:6%;
            right: 10%;
        }
	</style>
</head>
<body>
<form id="form2">
	<div id="Popup">
		<div id="SubPopup">
			<div class="form_boxC">
				<p>"<span class="f_cB">*</span>"号为不可修改项目</p>
				<table cellpadding="0" cellspacing="0">
					<tr>
						<th width="100">企业编号 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:100px;">
								<input name="comId" type="text" size="5" value=${enterpriseInfo.comId}>
							</div>
						</td>
					</tr>
					<tr>
						<th>企业名称 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:230px;">
								<input name="comName" type="text" size="20" value=${enterpriseInfo.comName}>
							</div>
						</td>
					</tr>
					<tr>
						<th>企业地点 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:230px;">
								<input name="comLocal" type="text" size="20" value=${enterpriseInfo.comLocal}>
							</div>
						</td>
					</tr>
					<tr>
						<th>招聘要求 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:230px;">
								<input name="recruitmentRequirements" type="text" size="20"
								       value=${enterpriseInfo.recruitmentRequirements}>
							</div>
						</td>
					</tr>
					<tr>
						<th>招聘地点 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:200px;">
								<input name="recruitmentPositions" type="text" size="10"
								       value=${enterpriseInfo.recruitmentPositions}>
							</div>
						</td>
					</tr>
					<tr>
						<th>薪资范围 <span class="f_cB"></span></th>
						<td>
							<div class="txtbox floatL" style="width:100px;">
								<input name="salaryRange" type="text" size="6" value=${enterpriseInfo.salaryRange}>
							</div>
						</td>
					</tr>
					<tr>
						<th>公司账号 <span class="f_cB">*</span></th>
						<td>
							<div class="txtbox floatL" style="width:140px;">
								<input name="comAccount" type="text" size="10"
								       value=${enterpriseInfo.comAccount} readonly>
							</div>
						</td>
					</tr>
					</tr>
				</table>
			</div>
			<div id="BtmBtn">
				<div class="btn_boxB floatR mag_l20">
					<button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;" type="submit" onclick="Update_Enterprise()">确定</button>
				</div>
				<div class="btn_box floatR">
					<button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;"><a style="color: white; text-decoration:none;" href="jsp/enterprise.jsp?comAccount=${enterpriseInfo.comAccount}">返回</a></button>
				</div>
			</div>
		</div>
	</div>
</form>
<img class="im1" src="img/cancle.png">
<div class="btnc">
	<button style="border-style:none;color:red;cursor:pointer;" onclick="Cancle_Enterprise(${enterpriseInfo.comId})">
		注销账户
	</button>
</div>
</body>
</html>

